public class Dollar extends Currency{
    public Dollar(double value) {
        super(value);
        this.value = value;
    }

    public boolean equals(Object other) {
        if( other instanceof Euro)
            return value / EXRATEUSDEURO == ((Euro) other).value;
        return other instanceof Dollar && value == ((Dollar) other).value;
    }

    public Dollar plus(Object other) {
        if(other instanceof Euro)
            return new Dollar(value + ((Euro) other).value * EXRATEUSDEURO);
        return new Dollar(value + ((Dollar) other).value);
    }
}
